import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import "../node_modules/element-ui/lib/theme-chalk/index.css"
import "./assets/css/global.css"
// import "./plugins/element.js"
import TreeTable from "vue-table-with-tree-grid"
import "./assets/font_bhpi8sa5t66/iconfont.css"
// 导入富文本编辑器
import VueQuillEditor from "vue-quill-editor"
//导入富文本编辑器样式
// import "quill/dist/quill.core.css"
// import "quill/dist/quill.snow.css"
// import "quill/dist/quill.bubble.css"
import axios from "axios"
Vue.config.productionTip = false
Vue.prototype.$http = axios

// 全局过滤器
Vue.filter("dataFormat", function(originValue) {
    const dt = new Date(originValue)
    const year = dt.getFullYear()
    const month = (dt.getMonth() + 1 + '').padStart(2, '0')
    const day = (dt.getDate() + '').padStart(2, '0')

    const hours = (dt.getHours() + '').padStart(2, '0')
    const minutes = (dt.getMinutes() + '').padStart(2, '0')
    const seconds = (dt.getSeconds() + '').padStart(2, '0')

    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
})

axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
    // 请求拦截器，config是请求对象
axios.interceptors.request.use(config => {
    config.headers.Authorization = sessionStorage.getItem("token")
    return config
})
Vue.component('tree-table', TreeTable)
    // 将富文本编辑器注册为全局组件
Vue.use(VueQuillEditor)
new Vue({
    router,
    render: h => h(App)
}).$mount('#app')